<?php
namespace app\index\model;

use think\Model;
use \app\common\libs\Lunar;

class Account extends Model
{
    protected $table = 'account';

	protected $readonly = ['mobile',''];
	protected $type = [
        'state'    =>  'integer',
        'create_time'     =>  'datetime',
        'update_time'  =>  'datetime',
        'delete_time'      =>  'datetime',
        'birthday'      =>  'date',
        'birthday_noli'      =>  'date',
    ];

    protected $update = ['birthday_noli'];  
  	

  	function setBirthdayNoliAttr() {
  		$lunar = new Lunar();
		$month = $lunar->getYinli($this->birthday);

		return $month[0].'-'.$month['month'].'-'.$month['day'];
  	}
}
